Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411314 Posts in 69330 Topics- by 58383 Members - Latest Member: Unicorling

April 03, 2024, 02:38:58 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Platformer physics twiddler
Pages: [1]
Print
Author Topic: Platformer physics twiddler  (Read 2725 times)
sublinimal
Level 8
***



View Profile
« on: July 15, 2013, 01:18:10 PM »


About:
This is a tool for graphically adjusting platformer physics variables in real-time. I was wondering why I couldn't find something like this, so I went and wrote one myself. It was initially meant for fine-tuning AIME's physics, but I figured it could be helpful to others too, so I'm making it public right here.

It's got some fancy mathy things like being able to set the desired jump height and the duration until the peak, which are meant to save you some tedious manual balancing.

How to use:
The character starts out with all forces zeroed, so drag some sliders around with your mouse. Then use the left/right keys to move the red box around and the up key to jump. There's three red lines around the controlled box, one for predicting your jump height, and two for predicting how far one tap will slide you (which isn't all that useful to be honest).

Here's what all the variables do exactly:
-xacc: added to the player's dx (horizontal movement) every frame a key is pressed
-maxspeed: dx is capped to this
-xslow: dx is divided by this every frame a key isn't pressed, causing smooth sliding instead of a quick stop
-yacc: added to dy (vertical movement) every frame
-jumpacc: the jump boost, subtracted from dy once when the jump key is pressed
-jumpheight: sets the jump height while keeping the same duration
-jumptime: sets the jump duration while keeping the same height

If you're wondering how you'd implement those in your game, you can find base code of my suggested use case over here.

Known bugs/improvements:
-The jump height/time sliders get stuck when the predicted jump hits a wall; move other sliders to refresh them for now
-The jumptime slider snaps when dragged really fast
-I guess you people would like a larger screen to work with, maybe different sizes of rectangles.
-More sliders?!
« Last Edit: July 16, 2013, 03:06:24 AM by sublinimal » Logged
raigan
Level 5
*****


View Profile
« Reply #1 on: July 15, 2013, 04:16:22 PM »

Thanks so much for making this, it's a really awesome tool/idea!

Do you have any plans to add basic level-editing (e.g click to toggle tile on/off)? Wink
Logged
oh ok
Level 0
***



View Profile
« Reply #2 on: July 15, 2013, 05:06:19 PM »

gravity, slopes?
friction or something?


good idea tho.
Logged
sublinimal
Level 8
***



View Profile
« Reply #3 on: July 15, 2013, 05:17:48 PM »

Do you have any plans to add basic level-editing (e.g click to toggle tile on/off)? Wink

Updated, you can do that now.

gravity, slopes?
friction or something?

Oboy. I might add more complex movement features as they're requested, but I think I'll worry about getting the basics perfect first. As in fixing the ceiling bug and having variable size rectangles/play area.

When I run out of space I might need to use some sort of tab system. GUI stuff's not my forte, though, so bear with me...
Logged
dto1138
Guest
« Reply #4 on: July 15, 2013, 05:22:20 PM »

This is awesome subliminal Smiley
Logged
sublinimal
Level 8
***



View Profile
« Reply #5 on: July 16, 2013, 03:03:53 AM »



Since there aren't much graphics beyond sliders, I might as well invest in them. This is how ugly they looked in case you missed it.
Logged
jmptable
Level 0
***



View Profile
« Reply #6 on: July 16, 2013, 04:43:50 AM »

Neat tool. Reminds me of the sort of tools that were demoed in this talk:

(10:40 for the most relevant part).
Logged
sublinimal
Level 8
***



View Profile
« Reply #7 on: July 16, 2013, 06:29:03 AM »

Neat tool. Reminds me of the sort of tools that were demoed in this talk:

(10:40 for the most relevant part).

Thanks for this, I totally get where he's coming from. I mean, just today I was ranting on IRC about how programming languages don't really allow you to work with ideas, how weird is that?

He talked about being able to make a jump around 12 minutes in. Made me think about something I tried when making a platformer with generated levels. I wanted the generator to place blocks so that the player always has a route to the finish, but I didn't manage to calculate which blocks the player could reach. I got it later and I think visualizing it would make a great addition for this.
Logged
Kurt
Level 5
*****



View Profile
« Reply #8 on: July 16, 2013, 11:43:44 AM »

Thanks a lot!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic